<?php


namespace app\server\model;

use app\index\model\Base;//default 不变，不要改
class ServerOrder extends Base
{
    protected $pk='order_id';
    protected $table = 'server_order';

    public function user()
    {
        return $this->belongsTo('app\user\model\User','u_id','u_id');
    }
    public function doctor()
    {
        return $this->belongsTo('app\doctor\model\Doctor','doc_id','doc_id');
    }
    public function servers()
    {
        return $this->belongsTo('Servers','s_id','s_id');
    }
    public function userAddress()
    {
        return $this->hasOne('app\user\model\UserAddress','ua_id','ua_id');
    }
    public function getorderTimeAttr($t)
    {
        return Date('Y-m-d H:i:s',$t);
    }

}